home *** CD-ROM | disk | FTP | other *** search
- /* SETDISK.C --- p. 663 */
- #include <stdio.h>
- #include <ctype.h>
- #include <dos.h>
- main()
- {
- int ch_in;
- int drive, maxdrives;
- printf("Enter new drive name (A, B etc): ");
- scanf("%c", &ch_in);
- /* Convert the letter into a number, 0 for A, 1 for B */
- drive = toupper(ch_in) - 'A';
- maxdrives = setdisk(drive);
- drive = getdisk();
- printf("The current drive is: %c\n", drive+'A');
- printf("There are %d logical drives on the system\n", maxdrives);
- }